﻿@using mooc.Models
@model IEnumerable<Product>
@{
    ViewData["Title"] = "Home Page";
}


<div class="text-center">

    <div class="m-1 p-1">

        <h3 class="display-4">欢迎</h3>
        <p>创建年轻人的 <a href="https://www.baidu.com">第一个 ASP.NET Core项目</a>.</p>
        <h4 class="bg-success text-xs-center p-1 text-white"> @ViewBag.Message</h4>
        <table class="table table-sm table-striped">
            <thead>
                <tr><th>ID</th><th>名称</th><th>分类</th><th>价格</th></tr>
            </thead>
            <tbody>
                @foreach (var p in Model)
                {
                    <tr>
                        <td>@p.ProductID</td>
                        <td>@p.Name</td>
                        <td>@p.Category</td>
                        <td>￥@p.Price.ToString("F2")</td>
                    </tr>
                }
            </tbody>
        </table>
    </div>
</div>